package tx.screens;

import java.awt.Graphics2D;

/**
 * Type that represents a screen of the game.  
 * @author Guilherme Mauro Germoglio Barbosa - germoglio@gmail.com
 */
public interface Screen {

	/**
	 * Updates the state of the screen based on the amount
	 * of elapsed time that has passed.
	 * @param elapsedTime The elapsed time.
	 */
	public void update(long elapsedTime);
	
	/**
	 * Draws the screen.
	 * @param g The Graphics2D to do this.
	 */
	public void draw(Graphics2D g);
	
	/**
	 * The next Screen that should be displayed. 
	 * @return The next Screen that should be displayed. Note that that 'next' screen can be
	 * <code>this</code>, since it is possible to not be the Screen should change.
	 */
	public Screen nextScreen();
	
	/**
	 * If game loop should be running.
	 * @return <code>true</code> if the game loop should be running, <code>false</code> otherwise.
	 */
	public boolean isRunning();
	
	/**
	 * Creates the instances needed to work.
	 */
	public void init();
	
	/**
	 * Stops and frees the instances needed to work.
	 */
	public void stop();
	
}
